package com.lqk.demo.jmm.exercise;

/**
 * @author lqk
 * @date 2021/12/28 20:50
 */
public class Singleton5 {
    private Singleton5() { }
    // 问题1：属于懒汉式还是饿汉式：懒汉式
    private static class LazyHolder {
        static final Singleton5 INSTANCE = new Singleton5();
    }
    // 问题2：在创建时是否有并发问题
    public static Singleton5 getInstance() {
        return LazyHolder.INSTANCE;
    }
}
